<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('牛奶上报列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>上报时间：</label>
                                <input type="text"  name="reportDate" th:value="${reportDate}" />
                            </li>
                            <li>
                                <label>班级：</label>
                                <input type="text"   name="className" th:value="${className}" />
                            </li>
                            <li>
                                <label>院区：</label>
                                <select name="campus" th:with="type=${@dict.getType('meal_campus')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>阶段：</label>
                                <select name="phase" disabled th:with="type=${@dict.getType('meal_mikl_phase')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>填报人：</label>
                                <input type="text" disabled name="reportingPerson"/>
                            </li>
                            <li>
<!--                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
<!--                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="meal:milk:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="meal:milk:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="meal:milk:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" >
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-bordered">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('meal:milk:edit')}]];
        var removeFlag = [[${@permission.hasPermi('meal:milk:remove')}]];
        var phaseDatas = [[${@dict.getType('meal_mikl_phase')}]];
        var prefix = ctx + "meal/milk";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "牛奶上报",
                columns: [
                    [
                        {
                            field: 'reportingPerson',
                            title: '',
                            colspan : 3
                        },
                        {
                            field: 'water6120',
                            align : 'center',
                            title: '6:00',
                            colspan : 5
                        } ,
                        {
                            field: 'water9120',
                            align : 'center',
                            title: '9:00',
                            colspan : 5
                        },
                        {
                            field: 'water13120',
                            title: '13:00',
                            align : 'center',
                            colspan : 5
                        },
                        {
                            field: 'water16120',
                            title: '16:00',
                            align : 'center',
                            colspan : 5
                        },
                        {
                            field: 'water20120',
                            title: '20:00',
                            align : 'center',
                            colspan : 5
                        },
                        {
                            field: 'water20120',
                            title: '00:00',
                            align : 'center',
                            colspan : 5
                        },
                        {
                            title: '',
                            align: 'center'
                        }]
                    ,
                    [{
                        checkbox: true
                    },
                        {
                            field: 'id',
                            title: 'id',
                            visible: false
                        } ,
                        {
                            field: 'phase',
                            title: '阶段'
                        },
                        {
                            field: 'water6120',
                            title: '水奶120ml'
                        },
                        {
                            field: 'water6200',
                            title: '水奶200ml'
                        },
                        {
                            field: 'paste6200',
                            title: '奶糊200ml'
                        },
                        {
                            field: 'paste6Te',
                            title: '奶糊特瓶'
                        },
                        {
                            field: 'empty6',
                            title: '空瓶'
                        },
                        {
                            field: 'water9120',
                            title: '水奶120ml'
                        },
                        {
                            field: 'water9200',
                            title: '水奶200ml'
                        },
                        {
                            field: 'paste9200',
                            title: '奶糊200ml'
                        },
                        {
                            field: 'paste9Te',
                            title: '奶糊特瓶'
                        },
                        {
                            field: 'empty9',
                            title: '空瓶'
                        },
                        {
                            field: 'water13120',
                            title: '水奶120ml'
                        },
                        {
                            field: 'water13200',
                            title: '水奶200ml'
                        },
                        {
                            field: 'paste13200',
                            title: '奶糊200ml'
                        },
                        {
                            field: 'paste13Te',
                            title: '奶糊特瓶'
                        },
                        {
                            field: 'empty13',
                            title: '空瓶'
                        },
                        {
                            field: 'water16120',
                            title: '水奶120ml'
                        },
                        {
                            field: 'water16200',
                            title: '水奶200ml_'
                        },
                        {
                            field: 'paste16200',
                            title: '奶糊200ml_'
                        },
                        {
                            field: 'paste16Te',
                            title: '奶糊特瓶'
                        },
                        {
                            field: 'empty16',
                            title: '空瓶'
                        },
                        {
                            field: 'water20120',
                            title: '水奶120ml'
                        },
                        {
                            field: 'water20200',
                            title: '水奶200ml'
                        },
                        {
                            field: 'paste20200',
                            title: '奶糊200ml'
                        },
                        {
                            field: 'paste20Te',
                            title: '奶糊特瓶'
                        },
                        {
                            field: 'empty20',
                            title: '空瓶'
                        },
                        {
                            field: 'water20120',
                            title: '水奶120ml'
                        },
                        {
                            field: 'water20200',
                            title: '水奶200ml'
                        },
                        {
                            field: 'paste20200',
                            title: '奶糊200ml'
                        },
                        {
                            field: 'paste20Te',
                            title: '奶糊特瓶'
                        },
                        {
                            field: 'empty20',
                            title: '空瓶'
                        },
                        {
                            title: '操作',
                            align: 'center',
                            formatter: function(value, row, index) {
                                var actions = [];
                                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                                actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                                return actions.join('');
                            }
                        }]
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>